package demoMod.invincibleOne.patches;

import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.megacrit.cardcrawl.screens.CardRewardScreen;
import demoMod.invincibleOne.InvincibleOneMod;

public class CardRewardScreenPatch {
    @SpirePatch(
            clz = CardRewardScreen.class,
            method = "takeReward"
    )
    public static class PatchTakeReward {
        public static void Prefix(CardRewardScreen screen) {
            if (screen.rItem != null) {
                InvincibleOneMod.bingoRewardList.getRewards().remove(screen.rItem);
            }
            InvincibleOneMod.bingoRewardList.claimingReward = false;
        }
    }

    @SpirePatch(
            clz = CardRewardScreen.class,
            method = "onClose"
    )
    public static class PatchOnClose {
        public static void Prefix(CardRewardScreen screen) {
            InvincibleOneMod.bingoRewardList.claimingReward = false;
        }
    }
}
